import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: () => import('@/views/Layout/index.vue'),
      children: [
        {
          path: '/home',
          component: () => import('@/views/Home/index.vue'),
          meta: { title: '首页' }
        },
        {
          path: '/study',
          component: () => import('@/views/Study/index.vue'),
          meta: { title: '学习' }
        },
        {
          path: '/person',
          component: () => import('@/views/Person/index.vue'),
          meta: { title: '个人中心' }
        }
      ]
    }
  ]
})

export default router
